package com.ruiysoft.service.comment.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruiysoft.entity.comment.CommentVo;
import com.ruiysoft.entity.comment.MerchandiseComment;
import com.ruiysoft.mapper.comment.MerchandiseCommentMapper;
import com.ruiysoft.service.comment.MerchandiseCommentService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author fanyl
 */
@Service
public class MerchandiseCommentServiceImpl extends ServiceImpl<MerchandiseCommentMapper, MerchandiseComment> implements MerchandiseCommentService {

    private final MerchandiseCommentMapper commentMapper;

    public MerchandiseCommentServiceImpl(MerchandiseCommentMapper commentMapper) {
        this.commentMapper = commentMapper;
    }

    @Override
    public int updateBatch(List<MerchandiseComment> list) {
        return baseMapper.updateBatch(list);
    }

    @Override
    public int batchInsert(List<MerchandiseComment> list) {
        return baseMapper.batchInsert(list);
    }

    @Override
    public int insertOrUpdate(MerchandiseComment record) {
        return baseMapper.insertOrUpdate(record);
    }

    @Override
    public int insertOrUpdateSelective(MerchandiseComment record) {
        return baseMapper.insertOrUpdateSelective(record);
    }

    @Override
    public List<CommentVo> queryBySpuId(Integer spuId) {
        return commentMapper.queryCommentsBySpuId(spuId);
    }


}




